<!DOCTYPE html>
<html lang="UTF-8" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <!-- jquery -->
        <script th:src="@{/js/jquery.min.js}" type="text/javascript"></script>
        <!-- bootstrap -->
        <link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}" type="text/css"/>
        <script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript"></script>
        <!-- jquery-validator -->
        <script th:src="@{/jquery-validation/jquery.validate.min.js}" type="text/javascript"></script>
        <script th:src="@{/jquery-validation/localization/messages_zh.min.js}" type="text/javascript"></script>
        <!-- layer -->
        <script th:src="@{/layer/layer.js}" type="text/javascript"></script>
        <!-- md5.js -->
        <script th:src="@{/js/md5.min.js}" type="text/javascript"></script>
        <!-- common.js -->
        <script th:src="@{/js/common.js}" type="text/javascript"></script>
        <title>商品列表</title>
    </head>
    <body>
        <!-- 引入公共头部 -->
        <div class="panel panel-default">
            <div id="head" th:include="common/head :: common_head"></div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">商品列表</div>
            <table class="table" id="goodslist">
                <tr>
                    <td>商品名称</td>
                    <td>商品图片</td>
                    <td>商品原价</td>
                    <td>秒杀价</td>
                    <td>库存数量</td>
                    <td>开始时间</td>
                    <td>结束时间</td>
                    <td>详情</td>
                </tr>
                <tr th:each="goods,goodsStat : ${goodsList}">
                    <td th:text="${goods.goodsName}"></td>
                    <!-- 从本机资源静态资源目录中获取 -->
                    <!--<td><img th:src="@{${goods.goodsImage}}" width="100" height="100"></td>-->
                    <td><img th:src="@{${goods.goodsImage}}" width="100" height="100"></td>
                    <td th:text="${goods.goodsPrice}"></td>
                    <td th:text="${goods.miaoshaPrice}"></td>
                    <td th:text="${goods.stockCount}"></td>
                    <td th:text="${#dates.format(goods.startDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td th:text="${#dates.format(goods.endDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td><a th:href="'/goods/to/detail/' + ${goods.id}">详情</a></td>
                </tr>
            </table>
        </div>
    </body>
</html>
